#!/bin/bash

#
# nxjbrowse: Browses files on the NXT
#
# June 7, 2007  created Lawrie Griffiths

if [ -z "$NXJ_HOME" ]; then 
  NXJ_HOME="$(dirname $(dirname $0))"
fi

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NXJ_HOME/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$NXJ_HOME/bin

if [ $OSTYPE == "cygwin" ]; then
  SEP=";"
else
  SEP=":"
fi

THIRDPARTY_LIBS="$NXJ_HOME/3rdparty/lib"

if [ `uname` == "Linux" ]; then
  BLUECOVELIBS="$THIRDPARTY_LIBS/bluecove.jar$SEP$THIRDPARTY_LIBS/bluecove-gpl.jar"
else
  BLUECOVELIBS="$THIRDPARTY_LIBS/bluecove.jar"
fi

java -Djava.library.path="$NXJ_HOME/bin" -Dnxj.home="$NXJ_HOME" -classpath "$THIRDPARTY_LIBS/bcel-5.1.jar$SEP$THIRDPARTY_LIBS/commons-cli-1.0.jar$SEP$NXJ_HOME/lib/pctools.jar$SEP$NXJ_HOME/lib/pccomm.jar$SEP$NXJ_HOME/lib/jtools.jar$SEP$BLUECOVELIBS$SEP." "$@"
